package com.great.dao;

import com.great.domain.Manage;

import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ManageDao {

    @Select("select count(*) from manage where manage_Name=#{manage_name}")//查询管理员个数
    public int managenamecheck(String manage_name);

    @Select("select * from manage where manage_Name=#{manage_name} and manage_Password=#{manage_password}")//登录判断
    public Manage selectbyname(@Param("manage_name") String manage_name, @Param("manage_password") String manage_password);

    @Select("select * from manage where manage_Name like '%${value}%' ")//搜索管理员
    public List<Manage> searchmanage(String keyword);

    @Delete("delete from manage where id=#{id}")//删除管理员
    public void delmanage(String id);

    @Insert("insert into manage (manage_Name,manage_Password) Values(#{manage_Name},#{manage_Password})")//添加管理员
    public void addmanage(Manage manage);

    @Select("select * from manage where id=#{id}")//查找某个管理员
    public Manage findById(String id);

    @Update("Update manage set manage_Name=#{manage_Name},manage_Password=#{manage_Password} where id=#{id}")//修改密码或名字
    public void updateById(Manage manage);
}
